package lock_ban;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

public class Product implements Serializable {
    @Serial
    private static final long serialVersionUID = -4900118599614533618L;
    private String color;
    private String name;

    public Product(String color, String name) {
        this.color = color;
        this.name = name;
    }

    public Product() {
    }

    public String getColor() {
        return color;
    }

    public void setColor(String color) {
        this.color = color;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Product product = (Product) o;
        return Objects.equals(color, product.color) && Objects.equals(name, product.name);
    }

    @Override
    public int hashCode() {
        return Objects.hash(color, name);
    }

    @Override
    public String toString() {
        return "Product{" +
                "color='" + color + '\'' +
                ", name='" + name + '\'' +
                '}';
    }
}
